* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f1012;
  color: #f3f4f6;
  padding-bottom: 78px;
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #15171b;
  border-bottom: 1px solid #2a2d33;
}

.back-btn {
  border: 1px solid #3a3f47;
  background: #20242a;
  color: #f3f4f6;
  border-radius: 8px;
  padding: 7px 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.topbar-brand {
  font-size: 12px;
  font-weight: 800;
  color: #e5e7eb;
}

.page-title {
  margin: 0 0 0 auto;
  font-size: 13px;
  color: #f3f4f6;
  font-weight: 700;
}

.game-header,
.input-section,
.confirm-popup {
  margin: 12px;
  border: 1px solid #2a2d33;
  border-radius: 12px;
  background: #15171b;
}

.game-header {
  overflow: hidden;
  text-align: center;
}

.game-banner { width: 100%; height: auto; display: block; }

.game-info { padding: 12px; }

.game-info h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #f9fafb;
}

.game-info p {
  margin: 0;
  font-size: 12px;
  color: #cbd5e1;
}

.input-section { padding: 12px; }

.input-section label {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #e5e7eb;
}

.section-title {
  margin: 0 0 8px;
  font-size: 13px;
  color: #f3f4f6;
  font-weight: 700;
}

.input-section input,
.input-section input[type='text'],
.input-section input[type='number'] {
  width: 100%;
  border: 1px solid #3a3f47;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  background: #111318;
  color: #f9fafb;
}

.input-section input:focus {
  outline: none;
  border-color: #6b7280;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #3a3f47;
  border-radius: 50%;
  background: #1f232a;
  color: #f3f4f6;
  cursor: pointer;
  font-weight: 700;
}

.ign-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.ign-row input { flex: 1; }

#getIgnBtn,
.pay-button button {
  border: 1px solid #3a3f47;
  background: #20242a;
  color: #f9fafb;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#getIgnBtn:hover,
.pay-button button:hover {
  background: #2b3139;
}

.pay-line {
  display: block;
  margin-bottom: 4px;
  color: #f3f4f6;
  font-size: 13px;
}

.pay-note {
  display: block;
  margin: 0 0 8px;
  font-size: 11px;
  color: #cbd5e1;
}

.error-text {
  color: #fca5a5;
  font-size: 11px;
}

.modal-overlay,
.confirm-popup-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  z-index: 400;
}

.guide-image {
  width: min(360px, calc(100% - 24px));
  border-radius: 10px;
  border: 1px solid #3a3f47;
}

.diamond-card-grid {
  margin: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.diamond-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #2f333b;
  border-radius: 10px;
  background: #181c22;
  padding: 10px;
  cursor: pointer;
  min-height: 84px;
}

.diamond-card.selected {
  border-color: #6b7280;
  background: #20242b;
}

.discount-label {
  position: absolute;
  top: 6px;
  right: 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  background: #374151;
  color: #fff;
}

.diamond-img { width: 32px; height: 32px; object-fit: contain; }
.diamond-details { min-width: 0; }

.diamond-title {
  font-size: 12px;
  font-weight: 700;
  color: #f3f4f6;
  line-height: 1.2;
}

.diamond-bonus {
  font-size: 11px;
  color: #cbd5e1;
  margin: 2px 0;
}

.diamond-prices { display: flex; align-items: center; gap: 6px; }
.old-price { font-size: 11px; color: #9ca3af; text-decoration: line-through; }
.new-price { font-size: 12px; color: #fff; font-weight: 700; }

.pay-button { margin: 14px 12px; text-align: center; }

.confirm-popup {
  width: min(380px, calc(100% - 24px));
  padding: 14px;
}

.confirm-popup h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #f3f4f6;
}

.confirm-popup p {
  margin: 5px 0;
  font-size: 12px;
  color: #e5e7eb;
}

.popup-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.popup-buttons button {
  flex: 1;
  border: 1px solid #3a3f47;
  border-radius: 8px;
  background: #20242a;
  color: #f9fafb;
  font-weight: 700;
  padding: 8px;
  cursor: pointer;
}

.popup-buttons .confirm {
  background: #f3f4f6;
  color: #111318;
  border-color: #f3f4f6;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 250;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #15171b;
  border-top: 1px solid #2a2d33;
}

.nav-bar { text-decoration: none; }

.nav-btn {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
}

.nav-btn img {
  width: 21px;
  height: 21px;
  margin-bottom: 4px;
  opacity: 0.72;
}

.nav-btn.active { color: #f3f4f6; }
.nav-btn.active img { opacity: 1; }

@media (min-width: 900px) {
  .diamond-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
